package com.th.supcom.pds.impl.manager.impl;

import java.util.List;
import java.util.Map;

import net.carefx.fc.framework.db.manager.GetSequenceHelper;

import org.apache.ibatis.session.RowBounds;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.th.supcom.pds.domain.pojo.InpPhamApplyDetail;
import com.th.supcom.pds.domain.pojo.InpPhamApplyDetailSummary;
import com.th.supcom.pds.domain.vo.InpPhamApplyDetailVO;
import com.th.supcom.pds.impl.dao.InpPhamApplyDetailMapper;
import com.th.supcom.pds.impl.manager.InpPhamApplyDetailManager;

/**
 * InpPhamApplyDetail 管理接口实现.
 * 
 * 住院摆药请领明细.
 */
public class InpPhamApplyDetailManagerImpl implements InpPhamApplyDetailManager
{
    public static final String TAB_INP_PHAM_APPLY_DETAIL = "INP_PHAM_APPLY_DETAIL";

    private InpPhamApplyDetailMapper m_inpPhamApplyDetailMapper;

    /** 序列生成器. */
    private GetSequenceHelper m_getSequenceHelper;

    /**
     * 默认的构造函数.
     */
    public InpPhamApplyDetailManagerImpl ()
    {

    }

    /**
     * 获取InpPhamApplyDetailMapper.
     * 
     * @return InpPhamApplyDetailMapper.
     */
    public InpPhamApplyDetailMapper getInpPhamApplyDetailMapper ()
    {
        return m_inpPhamApplyDetailMapper;
    }

    /**
     * 注入InpPhamApplyDetailMapper.
     * 
     * @param inpPhamApplyDetailMapper set inpPhamApplyDetailMapper.
     */
    public void setInpPhamApplyDetailMapper (InpPhamApplyDetailMapper inpPhamApplyDetailMapper)
    {
        m_inpPhamApplyDetailMapper = inpPhamApplyDetailMapper;
    }

    /**
     * 获取序列.
     * 
     * @return GetSequenceHelper
     */
    public GetSequenceHelper getGetSequenceHelper ()
    {
        return m_getSequenceHelper;
    }

    /**
     * 注入序列.
     * 
     * @param getSequenceHelper getSequenceHelper.
     */
    public void setGetSequenceHelper (GetSequenceHelper getSequenceHelper)
    {
        m_getSequenceHelper = getSequenceHelper;
    }

    @Override
    public void addInpPhamApplyDetailList (List <InpPhamApplyDetail> list)
    {
        for (InpPhamApplyDetail inpPhamApplyDetail : list)
        {
            inpPhamApplyDetail.setInpPhamApplyDetailId (getInpPhamApplyDetailSeq ());
        }
        m_inpPhamApplyDetailMapper.addInpPhamApplyDetailList (list);
    }

    @Override
    public InpPhamApplyDetail getInpPhamApplyDetailByID (Long id)
    {
        return m_inpPhamApplyDetailMapper.getInpPhamApplyDetailByID (id);
    }

    @Override
    public Long getInpPhamApplyDetailSeq ()
    {
        return m_getSequenceHelper.getNextSequenceId (TAB_INP_PHAM_APPLY_DETAIL);
    }

    @Override
    public List <InpPhamApplyDetailVO> findInpPhamApplyDetailListByExample (InpPhamApplyDetail inpPhamApplyDetail)
    {
        return m_inpPhamApplyDetailMapper.findInpPhamApplyDetailListByExample (inpPhamApplyDetail);
    }

    @Override
    public int findInpPhamApplyDetailCountByExample (InpPhamApplyDetail inpPhamApplyDetail)
    {
        return m_inpPhamApplyDetailMapper.findInpPhamApplyDetailCountByExample (inpPhamApplyDetail);
    }

    @Override
    public List <InpPhamApplyDetail> findInpPhamApplyDetailListByMap (Map <String, Object> params)
    {
        return m_inpPhamApplyDetailMapper.findInpPhamApplyDetailListByMap (params);
    }

    @Override
    public List <InpPhamApplyDetail> findInpPhamApplyDetailPagingByMap (Map <String, Object> params, Integer offset, Integer limit)
    {
        return m_inpPhamApplyDetailMapper.findInpPhamApplyDetailPagingByMap (new RowBounds (offset, limit), params);
    }

    @Override
    public Integer findInpPhamApplyDetailCountByMap (Map <String, Object> params)
    {
        return m_inpPhamApplyDetailMapper.findInpPhamApplyDetailCountByMap (params);
    }

    @Override
    public int modifyInpPhamApplyDetail (InpPhamApplyDetail inpPhamApplyDetail)
    {
        return m_inpPhamApplyDetailMapper.modifyInpPhamApplyDetail (inpPhamApplyDetail);
    }

    @Override
    public int modifyInpPhamApplyDetailByExample (InpPhamApplyDetail inpPhamApplyDetail)
    {
        return m_inpPhamApplyDetailMapper.modifyInpPhamApplyDetailByExample (inpPhamApplyDetail);
    }

    @Override
    public int removeInpPhamApplyDetailByID (Long id)
    {
        return m_inpPhamApplyDetailMapper.removeInpPhamApplyDetailByID (id);
    }

    @Override
    public int removeInpPhamApplyDetailByMap (Map <String, Object> params)
    {
        return m_inpPhamApplyDetailMapper.removeInpPhamApplyDetailByMap (params);
    }

    @Override
    public void addInpPhamApplyDetail (InpPhamApplyDetail inpPhamApplyDetail)
    {
        inpPhamApplyDetail.setInpPhamApplyDetailId (getInpPhamApplyDetailSeq ());
        m_inpPhamApplyDetailMapper.addInpPhamApplyDetail (inpPhamApplyDetail);
    }

    @Override
    public List <InpPhamApplyDetailVO> findOffsetPhamByNurseUnitCode (List <InpPhamApplyDetailSummary> list)
    {
        return m_inpPhamApplyDetailMapper.findOffsetPhamByNurseUnitCode (list);
    }

    @Override
    public List <InpPhamApplyDetailVO> findOffsetPhamList (List <InpPhamApplyDetailSummary> list)
    {
        return m_inpPhamApplyDetailMapper.findOffsetPhamList (list);
    }

    @Override
    public int modifyInpPhamApplyDetailList (List <InpPhamApplyDetail> list)
    {
        return m_inpPhamApplyDetailMapper.modifyInpPhamApplyDetailList (list);
    }

    @Override
    public String findPhamUnitByPhamStdCode (String phamStdCode)
    {
        return m_inpPhamApplyDetailMapper.findPhamUnitByPhamStdCode (phamStdCode);
    }
    @Override
    public List <InpPhamApplyDetail> findInpPhamApplyDetailForReturn (InpPhamApplyDetailVO inpPhamApplyDetailVO)
    {
        return m_inpPhamApplyDetailMapper.findInpPhamApplyDetailForReturn (inpPhamApplyDetailVO);
    }
    @Override
    public List <InpPhamApplyDetail> getDrugReturnIndicator (InpPhamApplyDetail inpPhamApplyDetail)
    {
        return m_inpPhamApplyDetailMapper.getDrugReturnIndicator (inpPhamApplyDetail);
    }
    @Override
    public List <InpPhamApplyDetailVO> findInpPhamApplyDetailListCondition (InpPhamApplyDetail inpPhamApplyDetail)
    {
        return m_inpPhamApplyDetailMapper.findInpPhamApplyDetailListByCondition (inpPhamApplyDetail);
         
    }
    /** 日志记录器. */
    public static final Logger s_logger = LoggerFactory.getLogger (InpPhamApplyDetailManagerImpl.class);

    /** 公司版权信息. */
    public static final String copyright = "Copyright 2014, TH Supcom Corporation";

    /** 提交路径. */
    public static final String SCC_BRANCH = "$URL$";

    /** 提交日期. */
    public static final String SCC_LAST_MODIFICATION_DATE = "$Date$";

    /** 最终修改人员. */
    public static final String SCC_LAST_MODIFIER_NAME = "$Author$";

    /** 最终版本号. */
    public static final String SCC_REVISION = "$Revision$";

    @Override
    public List <InpPhamApplyDetailVO> findInpPhamApplyCancelListByCondition (InpPhamApplyDetailVO inpPhamApplyDetail)
    {
       
        return m_inpPhamApplyDetailMapper.findInpPhamApplyCancelListByCondition (inpPhamApplyDetail);
         
    }

}